﻿using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace OpenAdmin.Database.Migrations.ApplicationDbContexts
{
    public partial class Initail : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterDatabase()
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "SysApiResource",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    Name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Code = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    LinkUrl = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Sort = table.Column<int>(type: "int", nullable: false),
                    CreateBy = table.Column<int>(type: "int", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    ModifyBy = table.Column<int>(type: "int", nullable: false),
                    ModifyTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
                    IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false),
                    Remark = table.Column<string>(type: "varchar(512)", maxLength: 512, nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysApiResource", x => x.Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "SysMenu",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    Name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    ParentId = table.Column<int>(type: "int", nullable: false),
                    Route = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Icon = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Enabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
                    Sort = table.Column<int>(type: "int", nullable: false),
                    CreateBy = table.Column<int>(type: "int", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    ModifyBy = table.Column<int>(type: "int", nullable: false),
                    ModifyTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
                    IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false),
                    Remark = table.Column<string>(type: "varchar(512)", maxLength: 512, nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysMenu", x => x.Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "SysOperation",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    Name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Code = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    MenuId = table.Column<int>(type: "int", nullable: false),
                    ApiResourceId = table.Column<int>(type: "int", nullable: false),
                    ParentId = table.Column<int>(type: "int", nullable: false),
                    Sort = table.Column<int>(type: "int", nullable: false),
                    CreateBy = table.Column<int>(type: "int", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    ModifyBy = table.Column<int>(type: "int", nullable: false),
                    ModifyTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
                    IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false),
                    Remark = table.Column<string>(type: "varchar(512)", maxLength: 512, nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysOperation", x => x.Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "SysPermission",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    Type = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    CreateBy = table.Column<int>(type: "int", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    ModifyBy = table.Column<int>(type: "int", nullable: false),
                    ModifyTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
                    IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false),
                    Remark = table.Column<string>(type: "varchar(512)", maxLength: 512, nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysPermission", x => x.Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "SysPermissionMenu",
                columns: table => new
                {
                    PermissionId = table.Column<int>(type: "int", nullable: false),
                    MenuId = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysPermissionMenu", x => new { x.PermissionId, x.MenuId });
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "SysPermissionOperation",
                columns: table => new
                {
                    PermissionId = table.Column<int>(type: "int", nullable: false),
                    OperationId = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysPermissionOperation", x => new { x.PermissionId, x.OperationId });
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "SysRole",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    Name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Enabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
                    CreateBy = table.Column<int>(type: "int", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    ModifyBy = table.Column<int>(type: "int", nullable: false),
                    ModifyTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
                    TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false),
                    Remark = table.Column<string>(type: "varchar(512)", maxLength: 512, nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysRole", x => x.Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "SysRolePermission",
                columns: table => new
                {
                    RoleId = table.Column<int>(type: "int", nullable: false),
                    PermissionId = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysRolePermission", x => new { x.RoleId, x.PermissionId });
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "SysUser",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    UserName = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Password = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    RealName = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Avatar = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Status = table.Column<int>(type: "int", nullable: false),
                    UserType = table.Column<int>(type: "int", nullable: false),
                    LastLoginTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: true),
                    Gender = table.Column<int>(type: "int", nullable: false),
                    Age = table.Column<int>(type: "int", nullable: false),
                    Birthday = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: true),
                    CreateBy = table.Column<int>(type: "int", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    ModifyBy = table.Column<int>(type: "int", nullable: false),
                    ModifyTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
                    TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false),
                    Remark = table.Column<string>(type: "varchar(512)", maxLength: 512, nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysUser", x => x.Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "SysUserRole",
                columns: table => new
                {
                    UserId = table.Column<int>(type: "int", nullable: false),
                    RoleId = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysUserRole", x => new { x.UserId, x.RoleId });
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.InsertData(
                table: "SysApiResource",
                columns: new[] { "Id", "Code", "CreateBy", "CreateTime", "IsDeleted", "LinkUrl", "ModifyBy", "ModifyTime", "Name", "Remark", "Sort" },
                values: new object[,]
                {
                    { 1, "", 1, new DateTime(2022, 12, 18, 18, 13, 12, 625, DateTimeKind.Local).AddTicks(4299), false, "/api/user/getusersbypage", 0, null, "分页获取用户列表", null, 1 },
                    { 2, "", 1, new DateTime(2022, 12, 18, 18, 13, 12, 625, DateTimeKind.Local).AddTicks(4308), false, "/api/role/getrolesbypage", 0, null, "分页获取角色列表", null, 2 },
                    { 3, "", 1, new DateTime(2022, 12, 18, 18, 13, 12, 625, DateTimeKind.Local).AddTicks(4310), false, "/api/apiresource/getapiresourcesbypage", 0, null, "分页获取api接口列表", null, 3 },
                    { 4, "", 1, new DateTime(2022, 12, 18, 18, 13, 12, 625, DateTimeKind.Local).AddTicks(4311), false, "/api/menu/getmenus", 0, null, "获取全部菜单列表", null, 4 },
                    { 5, "", 1, new DateTime(2022, 12, 18, 18, 13, 12, 625, DateTimeKind.Local).AddTicks(4312), false, "/api/role/getroles", 0, null, "获取全部角色列表", null, 5 },
                    { 6, "", 1, new DateTime(2022, 12, 18, 18, 13, 12, 625, DateTimeKind.Local).AddTicks(4315), false, "/api/permission/getpermissions", 0, null, "获取全部权限列表", null, 6 },
                    { 7, "", 1, new DateTime(2022, 12, 18, 18, 13, 12, 625, DateTimeKind.Local).AddTicks(4316), false, "/api/permission/getrolepermissions", 0, null, "获取角色权限列表", null, 7 },
                    { 8, "", 1, new DateTime(2022, 12, 18, 18, 13, 12, 625, DateTimeKind.Local).AddTicks(4318), false, "/api/apiresource/getapiresources", 0, null, "获取全部api接口列表", null, 8 },
                    { 9, "", 1, new DateTime(2022, 12, 18, 18, 13, 12, 625, DateTimeKind.Local).AddTicks(4319), false, "/api/operation/getoperationsbymenuid", 0, null, "获取菜单操作功能", null, 9 },
                    { 10, "", 1, new DateTime(2022, 12, 18, 18, 13, 12, 625, DateTimeKind.Local).AddTicks(4322), false, "/api/user/adduser", 0, null, "添加用户", null, 10 },
                    { 11, "", 1, new DateTime(2022, 12, 18, 18, 13, 12, 625, DateTimeKind.Local).AddTicks(4323), false, "/api/user/edituser", 0, null, "编辑用户", null, 11 },
                    { 12, "", 1, new DateTime(2022, 12, 18, 18, 13, 12, 625, DateTimeKind.Local).AddTicks(4324), false, "/api/user/deleteuser", 0, null, "删除用户", null, 12 },
                    { 13, "", 1, new DateTime(2022, 12, 18, 18, 13, 12, 625, DateTimeKind.Local).AddTicks(4326), false, "/api/role/getrolesbyuserid", 0, null, "根据用户获取角色", null, 13 },
                    { 14, "", 1, new DateTime(2022, 12, 18, 18, 13, 12, 625, DateTimeKind.Local).AddTicks(4327), false, "/api/user/distributionrole", 0, null, "为用户分配角色", null, 14 },
                    { 15, "", 1, new DateTime(2022, 12, 18, 18, 13, 12, 625, DateTimeKind.Local).AddTicks(4328), false, "/api/role/addrole", 0, null, "添加角色", null, 15 },
                    { 16, "", 1, new DateTime(2022, 12, 18, 18, 13, 12, 625, DateTimeKind.Local).AddTicks(4329), false, "/api/role/editrole", 0, null, "编辑角色", null, 16 },
                    { 17, "", 1, new DateTime(2022, 12, 18, 18, 13, 12, 625, DateTimeKind.Local).AddTicks(4331), false, "/api/role/deleterole", 0, null, "删除角色", null, 17 },
                    { 18, "", 1, new DateTime(2022, 12, 18, 18, 13, 12, 625, DateTimeKind.Local).AddTicks(4333), false, "/api/apiresource/addapiresource", 0, null, "添加接口", null, 18 },
                    { 19, "", 1, new DateTime(2022, 12, 18, 18, 13, 12, 625, DateTimeKind.Local).AddTicks(4334), false, "/api/apiresource/editapiresource", 0, null, "编辑接口", null, 19 },
                    { 20, "", 1, new DateTime(2022, 12, 18, 18, 13, 12, 625, DateTimeKind.Local).AddTicks(4335), false, "/api/apiresource/deleteapiresource", 0, null, "删除接口", null, 20 },
                    { 21, "", 1, new DateTime(2022, 12, 18, 18, 13, 12, 625, DateTimeKind.Local).AddTicks(4337), false, "/api/menu/addmenu", 0, null, "添加菜单", null, 21 },
                    { 22, "", 1, new DateTime(2022, 12, 18, 18, 13, 12, 625, DateTimeKind.Local).AddTicks(4338), false, "/api/menu/editmenu", 0, null, "编辑菜单", null, 22 },
                    { 23, "", 1, new DateTime(2022, 12, 18, 18, 13, 12, 625, DateTimeKind.Local).AddTicks(4339), false, "/api/menu/deletemenu", 0, null, "删除菜单", null, 23 },
                    { 24, "", 1, new DateTime(2022, 12, 18, 18, 13, 12, 625, DateTimeKind.Local).AddTicks(4380), false, "/api/permission/saverolepermission", 0, null, "保存角色权限", null, 24 },
                    { 25, "", 1, new DateTime(2022, 12, 18, 18, 13, 12, 625, DateTimeKind.Local).AddTicks(4382), false, "/api/operation/addoperation", 0, null, "添加菜单功能", null, 25 },
                    { 26, "", 1, new DateTime(2022, 12, 18, 18, 13, 12, 625, DateTimeKind.Local).AddTicks(4383), false, "/api/operation/editoperation", 0, null, "编辑菜单功能", null, 26 },
                    { 27, "", 1, new DateTime(2022, 12, 18, 18, 13, 12, 625, DateTimeKind.Local).AddTicks(4385), false, "/api/operation/deleteoperation", 0, null, "删除菜单功能", null, 27 }
                });

            migrationBuilder.InsertData(
                table: "SysMenu",
                columns: new[] { "Id", "CreateBy", "CreateTime", "Enabled", "Icon", "IsDeleted", "ModifyBy", "ModifyTime", "Name", "ParentId", "Remark", "Route", "Sort" },
                values: new object[,]
                {
                    { 1, 1, new DateTime(2022, 12, 18, 18, 13, 12, 626, DateTimeKind.Local).AddTicks(7295), true, "platform", false, 0, null, "平台管理", 0, null, "/platform", 1 },
                    { 2, 1, new DateTime(2022, 12, 18, 18, 13, 12, 626, DateTimeKind.Local).AddTicks(7302), true, "menu", false, 0, null, "菜单管理", 1, null, "/platform/menu", 1 },
                    { 3, 1, new DateTime(2022, 12, 18, 18, 13, 12, 626, DateTimeKind.Local).AddTicks(7304), true, "api", false, 0, null, "接口管理", 1, null, "/platform/api", 2 },
                    { 4, 1, new DateTime(2022, 12, 18, 18, 13, 12, 626, DateTimeKind.Local).AddTicks(7305), true, "operation", false, 0, null, "功能操作", 1, null, "/platform/operation", 3 },
                    { 5, 1, new DateTime(2022, 12, 18, 18, 13, 12, 626, DateTimeKind.Local).AddTicks(7307), true, "tenant", false, 0, null, "租户管理", 1, null, "/platform/tenant", 4 },
                    { 6, 1, new DateTime(2022, 12, 18, 18, 13, 12, 626, DateTimeKind.Local).AddTicks(7309), true, "system", false, 0, null, "系统管理", 0, null, "/system", 2 },
                    { 7, 1, new DateTime(2022, 12, 18, 18, 13, 12, 626, DateTimeKind.Local).AddTicks(7311), true, "user", false, 0, null, "用户管理", 6, null, "/system/user", 1 },
                    { 8, 1, new DateTime(2022, 12, 18, 18, 13, 12, 626, DateTimeKind.Local).AddTicks(7312), true, "role", false, 0, null, "角色管理", 6, null, "/system/role", 2 },
                    { 9, 1, new DateTime(2022, 12, 18, 18, 13, 12, 626, DateTimeKind.Local).AddTicks(7314), true, "permission", false, 0, null, "权限分配", 6, null, "/system/permission", 3 },
                    { 10, 1, new DateTime(2022, 12, 18, 18, 13, 12, 626, DateTimeKind.Local).AddTicks(7362), true, "personalCenter", false, 0, null, "个人管理", 0, null, "/person", 3 },
                    { 11, 1, new DateTime(2022, 12, 18, 18, 13, 12, 626, DateTimeKind.Local).AddTicks(7363), true, "personalCenter", false, 0, null, "个人中心", 10, null, "/person/center", 1 }
                });

            migrationBuilder.InsertData(
                table: "SysOperation",
                columns: new[] { "Id", "ApiResourceId", "Code", "CreateBy", "CreateTime", "IsDeleted", "MenuId", "ModifyBy", "ModifyTime", "Name", "ParentId", "Remark", "Sort" },
                values: new object[,]
                {
                    { 1, 1, "getusersbypage", 1, new DateTime(2022, 12, 18, 18, 13, 12, 628, DateTimeKind.Local).AddTicks(58), false, 7, 0, null, "分页获取用户列表", 0, null, 1 },
                    { 2, 10, "adduser", 1, new DateTime(2022, 12, 18, 18, 13, 12, 628, DateTimeKind.Local).AddTicks(66), false, 7, 0, null, "新增用户", 0, null, 2 },
                    { 3, 11, "getusersbypage", 1, new DateTime(2022, 12, 18, 18, 13, 12, 628, DateTimeKind.Local).AddTicks(68), false, 7, 0, null, "编辑用户", 0, null, 3 },
                    { 4, 12, "getusersbypage", 1, new DateTime(2022, 12, 18, 18, 13, 12, 628, DateTimeKind.Local).AddTicks(69), false, 7, 0, null, "删除用户", 0, null, 4 },
                    { 5, 5, "getroles", 1, new DateTime(2022, 12, 18, 18, 13, 12, 628, DateTimeKind.Local).AddTicks(71), false, 7, 0, null, "获取全部角色列表", 0, null, 5 },
                    { 6, 13, "getrolesbyuserid", 1, new DateTime(2022, 12, 18, 18, 13, 12, 628, DateTimeKind.Local).AddTicks(74), false, 7, 0, null, "根据用户获取角色", 0, null, 6 },
                    { 7, 14, "distributionrole", 1, new DateTime(2022, 12, 18, 18, 13, 12, 628, DateTimeKind.Local).AddTicks(75), false, 7, 0, null, "为用户分配角色", 0, null, 7 },
                    { 8, 2, "getrolesbypage", 1, new DateTime(2022, 12, 18, 18, 13, 12, 628, DateTimeKind.Local).AddTicks(76), false, 8, 0, null, "分页获取角色列表", 0, null, 8 },
                    { 9, 15, "addrole", 1, new DateTime(2022, 12, 18, 18, 13, 12, 628, DateTimeKind.Local).AddTicks(78), false, 8, 0, null, "添加角色", 0, null, 9 },
                    { 10, 16, "editrole", 1, new DateTime(2022, 12, 18, 18, 13, 12, 628, DateTimeKind.Local).AddTicks(81), false, 8, 0, null, "编辑角色", 0, null, 10 },
                    { 11, 17, "deleterole", 1, new DateTime(2022, 12, 18, 18, 13, 12, 628, DateTimeKind.Local).AddTicks(82), false, 8, 0, null, "删除角色", 0, null, 11 },
                    { 12, 3, "getapiresourcesbypage", 1, new DateTime(2022, 12, 18, 18, 13, 12, 628, DateTimeKind.Local).AddTicks(83), false, 3, 0, null, "分页获取api接口列表", 0, null, 12 },
                    { 13, 18, "addapi", 1, new DateTime(2022, 12, 18, 18, 13, 12, 628, DateTimeKind.Local).AddTicks(85), false, 3, 0, null, "添加接口", 0, null, 13 },
                    { 14, 19, "editapi", 1, new DateTime(2022, 12, 18, 18, 13, 12, 628, DateTimeKind.Local).AddTicks(86), false, 3, 0, null, "编辑接口", 0, null, 14 },
                    { 15, 20, "deleteapi", 1, new DateTime(2022, 12, 18, 18, 13, 12, 628, DateTimeKind.Local).AddTicks(88), false, 3, 0, null, "删除接口", 0, null, 15 },
                    { 16, 4, "getmenus", 1, new DateTime(2022, 12, 18, 18, 13, 12, 628, DateTimeKind.Local).AddTicks(89), false, 2, 0, null, "获取全部菜单列表", 0, null, 16 },
                    { 17, 21, "addmenu", 1, new DateTime(2022, 12, 18, 18, 13, 12, 628, DateTimeKind.Local).AddTicks(165), false, 2, 0, null, "添加菜单", 0, null, 17 },
                    { 18, 22, "editmenu", 1, new DateTime(2022, 12, 18, 18, 13, 12, 628, DateTimeKind.Local).AddTicks(168), false, 2, 0, null, "编辑菜单", 0, null, 18 },
                    { 19, 23, "deletemenu", 1, new DateTime(2022, 12, 18, 18, 13, 12, 628, DateTimeKind.Local).AddTicks(170), false, 2, 0, null, "删除菜单", 0, null, 19 },
                    { 20, 4, "getmenus", 1, new DateTime(2022, 12, 18, 18, 13, 12, 628, DateTimeKind.Local).AddTicks(171), false, 4, 0, null, "获取全部菜单列表", 0, null, 20 },
                    { 21, 9, "getoperationsbymenuid", 1, new DateTime(2022, 12, 18, 18, 13, 12, 628, DateTimeKind.Local).AddTicks(172), false, 4, 0, null, "获取菜单操作功能", 0, null, 21 },
                    { 22, 25, "addoperation", 1, new DateTime(2022, 12, 18, 18, 13, 12, 628, DateTimeKind.Local).AddTicks(174), false, 4, 0, null, "添加菜单功能", 0, null, 22 },
                    { 23, 26, "editoperation", 1, new DateTime(2022, 12, 18, 18, 13, 12, 628, DateTimeKind.Local).AddTicks(176), false, 4, 0, null, "编辑菜单功能", 0, null, 23 },
                    { 24, 27, "deleteoperation", 1, new DateTime(2022, 12, 18, 18, 13, 12, 628, DateTimeKind.Local).AddTicks(177), false, 4, 0, null, "删除菜单功能", 0, null, 24 },
                    { 25, 8, "getapiresources", 1, new DateTime(2022, 12, 18, 18, 13, 12, 628, DateTimeKind.Local).AddTicks(179), false, 4, 0, null, "获取全部api接口列表", 0, null, 25 },
                    { 26, 5, "getroles", 1, new DateTime(2022, 12, 18, 18, 13, 12, 628, DateTimeKind.Local).AddTicks(180), false, 9, 0, null, "获取全部角色列表", 0, null, 26 },
                    { 27, 6, "getpermissions", 1, new DateTime(2022, 12, 18, 18, 13, 12, 628, DateTimeKind.Local).AddTicks(181), false, 9, 0, null, "获取全部权限列表", 0, null, 27 },
                    { 28, 7, "getrolepermissions", 1, new DateTime(2022, 12, 18, 18, 13, 12, 628, DateTimeKind.Local).AddTicks(183), false, 9, 0, null, "获取角色权限列表", 0, null, 28 },
                    { 29, 24, "saverolepermission", 1, new DateTime(2022, 12, 18, 18, 13, 12, 628, DateTimeKind.Local).AddTicks(184), false, 9, 0, null, "保存角色权限", 0, null, 29 }
                });

            migrationBuilder.InsertData(
                table: "SysPermission",
                columns: new[] { "Id", "CreateBy", "CreateTime", "IsDeleted", "ModifyBy", "ModifyTime", "Name", "Remark", "Type" },
                values: new object[,]
                {
                    { 1, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(163), false, 0, null, "平台管理", null, "MENU" },
                    { 2, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(167), false, 0, null, "菜单管理", null, "MENU" },
                    { 3, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(168), false, 0, null, "接口管理", null, "MENU" },
                    { 4, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(169), false, 0, null, "功能操作", null, "MENU" },
                    { 5, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(170), false, 0, null, "租户管理", null, "MENU" },
                    { 6, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(171), false, 0, null, "系统管理", null, "MENU" },
                    { 7, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(173), false, 0, null, "用户管理", null, "MENU" },
                    { 8, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(174), false, 0, null, "角色管理", null, "MENU" },
                    { 9, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(175), false, 0, null, "权限分配", null, "MENU" },
                    { 10, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(176), false, 0, null, "个人管理", null, "MENU" },
                    { 11, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(177), false, 0, null, "个人中心", null, "MENU" },
                    { 12, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(285), false, 0, null, "分页获取用户列表", null, "OPERATION" },
                    { 13, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(288), false, 0, null, "新增用户", null, "OPERATION" },
                    { 14, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(289), false, 0, null, "编辑用户", null, "OPERATION" },
                    { 15, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(290), false, 0, null, "删除用户", null, "OPERATION" },
                    { 16, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(291), false, 0, null, "获取全部角色列表", null, "OPERATION" },
                    { 17, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(293), false, 0, null, "根据用户获取角色", null, "OPERATION" },
                    { 18, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(294), false, 0, null, "为用户分配角色", null, "OPERATION" },
                    { 19, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(294), false, 0, null, "分页获取角色列表", null, "OPERATION" },
                    { 20, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(295), false, 0, null, "添加角色", null, "OPERATION" },
                    { 21, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(297), false, 0, null, "编辑角色", null, "OPERATION" },
                    { 22, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(298), false, 0, null, "删除角色", null, "OPERATION" },
                    { 23, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(299), false, 0, null, "分页获取api接口列表", null, "OPERATION" },
                    { 24, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(300), false, 0, null, "添加接口", null, "OPERATION" },
                    { 25, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(301), false, 0, null, "编辑接口", null, "OPERATION" },
                    { 26, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(301), false, 0, null, "删除接口", null, "OPERATION" },
                    { 27, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(302), false, 0, null, "获取全部菜单列表", null, "OPERATION" },
                    { 28, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(303), false, 0, null, "添加菜单", null, "OPERATION" },
                    { 29, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(305), false, 0, null, "编辑菜单", null, "OPERATION" },
                    { 30, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(306), false, 0, null, "删除菜单", null, "OPERATION" },
                    { 31, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(307), false, 0, null, "获取全部菜单列表", null, "OPERATION" },
                    { 32, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(308), false, 0, null, "获取菜单操作功能", null, "OPERATION" },
                    { 33, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(308), false, 0, null, "添加菜单功能", null, "OPERATION" },
                    { 34, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(309), false, 0, null, "编辑菜单功能", null, "OPERATION" },
                    { 35, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(310), false, 0, null, "删除菜单功能", null, "OPERATION" },
                    { 36, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(311), false, 0, null, "获取全部api接口列表", null, "OPERATION" },
                    { 37, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(312), false, 0, null, "获取全部角色列表", null, "OPERATION" },
                    { 38, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(313), false, 0, null, "获取全部权限列表", null, "OPERATION" },
                    { 39, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(314), false, 0, null, "获取角色权限列表", null, "OPERATION" },
                    { 40, 1, new DateTime(2022, 12, 18, 18, 13, 12, 629, DateTimeKind.Local).AddTicks(315), false, 0, null, "保存角色权限", null, "OPERATION" }
                });

            migrationBuilder.InsertData(
                table: "SysPermissionMenu",
                columns: new[] { "MenuId", "PermissionId" },
                values: new object[,]
                {
                    { 1, 1 },
                    { 2, 2 },
                    { 3, 3 },
                    { 4, 4 },
                    { 5, 5 },
                    { 6, 6 },
                    { 7, 7 },
                    { 8, 8 },
                    { 9, 9 },
                    { 10, 10 },
                    { 11, 11 }
                });

            migrationBuilder.InsertData(
                table: "SysPermissionOperation",
                columns: new[] { "OperationId", "PermissionId" },
                values: new object[,]
                {
                    { 1, 12 },
                    { 2, 13 },
                    { 3, 14 },
                    { 4, 15 },
                    { 5, 16 },
                    { 6, 17 },
                    { 7, 18 },
                    { 8, 19 },
                    { 9, 20 },
                    { 10, 21 },
                    { 11, 22 },
                    { 12, 23 },
                    { 13, 24 },
                    { 14, 25 },
                    { 15, 26 },
                    { 16, 27 },
                    { 17, 28 },
                    { 18, 29 },
                    { 19, 30 },
                    { 20, 31 },
                    { 21, 32 },
                    { 22, 33 },
                    { 23, 34 },
                    { 24, 35 },
                    { 25, 36 },
                    { 26, 37 },
                    { 27, 38 },
                    { 28, 39 },
                    { 29, 40 }
                });

            migrationBuilder.InsertData(
                table: "SysRole",
                columns: new[] { "Id", "CreateBy", "CreateTime", "Enabled", "IsDeleted", "ModifyBy", "ModifyTime", "Name", "Remark", "TenantId" },
                values: new object[,]
                {
                    { 1, 1, new DateTime(2022, 12, 18, 18, 13, 12, 631, DateTimeKind.Local).AddTicks(2677), true, false, 0, null, "系统管理员", "系统管理员", new Guid("be066e77-c7a8-9181-5e9d-5457acd286bf") },
                    { 2, 1, new DateTime(2022, 12, 18, 18, 13, 12, 631, DateTimeKind.Local).AddTicks(2697), true, false, 0, null, "普通用户", "普通用户", new Guid("be066e77-c7a8-9181-5e9d-5457acd286bf") },
                    { 3, 1, new DateTime(2022, 12, 18, 18, 13, 12, 631, DateTimeKind.Local).AddTicks(2700), true, false, 0, null, "系统管理员", "系统管理员", new Guid("d4bb6bca-0da1-bfed-7df5-209f09641aef") },
                    { 4, 1, new DateTime(2022, 12, 18, 18, 13, 12, 631, DateTimeKind.Local).AddTicks(2703), true, false, 0, null, "普通用户", "普通用户", new Guid("d4bb6bca-0da1-bfed-7df5-209f09641aef") }
                });

            migrationBuilder.InsertData(
                table: "SysRolePermission",
                columns: new[] { "PermissionId", "RoleId" },
                values: new object[,]
                {
                    { 1, 1 },
                    { 2, 1 },
                    { 3, 1 },
                    { 4, 1 },
                    { 6, 1 },
                    { 7, 1 },
                    { 8, 1 },
                    { 9, 1 },
                    { 10, 1 },
                    { 11, 1 },
                    { 12, 1 },
                    { 13, 1 },
                    { 14, 1 },
                    { 15, 1 },
                    { 16, 1 },
                    { 17, 1 },
                    { 18, 1 },
                    { 19, 1 },
                    { 20, 1 },
                    { 21, 1 },
                    { 22, 1 },
                    { 23, 1 },
                    { 24, 1 },
                    { 25, 1 },
                    { 26, 1 },
                    { 27, 1 },
                    { 28, 1 },
                    { 29, 1 },
                    { 30, 1 },
                    { 31, 1 },
                    { 32, 1 },
                    { 33, 1 },
                    { 34, 1 },
                    { 35, 1 },
                    { 36, 1 },
                    { 37, 1 },
                    { 38, 1 },
                    { 39, 1 },
                    { 40, 1 }
                });

            migrationBuilder.InsertData(
                table: "SysUser",
                columns: new[] { "Id", "Age", "Avatar", "Birthday", "CreateBy", "CreateTime", "Gender", "IsDeleted", "LastLoginTime", "ModifyBy", "ModifyTime", "Password", "RealName", "Remark", "Status", "TenantId", "UserName", "UserType" },
                values: new object[,]
                {
                    { 1, 0, "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif", null, 1, new DateTime(2022, 12, 18, 18, 13, 12, 631, DateTimeKind.Local).AddTicks(9099), 0, false, null, 0, null, "E10ADC3949BA59ABBE56E057F20F883E", "超级管理员", null, 1, new Guid("be066e77-c7a8-9181-5e9d-5457acd286bf"), "superAdmin", 1 },
                    { 2, 0, "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif", null, 1, new DateTime(2022, 12, 18, 18, 13, 12, 631, DateTimeKind.Local).AddTicks(9326), 0, false, null, 0, null, "E10ADC3949BA59ABBE56E057F20F883E", "系统管理员", null, 1, new Guid("be066e77-c7a8-9181-5e9d-5457acd286bf"), "admin", 2 },
                    { 3, 0, "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif", null, 1, new DateTime(2022, 12, 18, 18, 13, 12, 631, DateTimeKind.Local).AddTicks(9350), 0, false, null, 0, null, "E10ADC3949BA59ABBE56E057F20F883E", "普通用户", null, 1, new Guid("be066e77-c7a8-9181-5e9d-5457acd286bf"), "johnny", 3 },
                    { 4, 0, "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif", null, 1, new DateTime(2022, 12, 18, 18, 13, 12, 631, DateTimeKind.Local).AddTicks(9374), 0, false, null, 0, null, "E10ADC3949BA59ABBE56E057F20F883E", "系统管理员", null, 1, new Guid("d4bb6bca-0da1-bfed-7df5-209f09641aef"), "johnny@163.com", 2 },
                    { 5, 0, "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif", null, 1, new DateTime(2022, 12, 18, 18, 13, 12, 631, DateTimeKind.Local).AddTicks(9394), 0, false, null, 0, null, "E10ADC3949BA59ABBE56E057F20F883E", "普通用户", null, 1, new Guid("d4bb6bca-0da1-bfed-7df5-209f09641aef"), "user01@163.com", 3 }
                });

            migrationBuilder.InsertData(
                table: "SysUserRole",
                columns: new[] { "RoleId", "UserId" },
                values: new object[,]
                {
                    { 1, 2 },
                    { 2, 3 },
                    { 3, 4 },
                    { 4, 5 }
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "SysApiResource");

            migrationBuilder.DropTable(
                name: "SysMenu");

            migrationBuilder.DropTable(
                name: "SysOperation");

            migrationBuilder.DropTable(
                name: "SysPermission");

            migrationBuilder.DropTable(
                name: "SysPermissionMenu");

            migrationBuilder.DropTable(
                name: "SysPermissionOperation");

            migrationBuilder.DropTable(
                name: "SysRole");

            migrationBuilder.DropTable(
                name: "SysRolePermission");

            migrationBuilder.DropTable(
                name: "SysUser");

            migrationBuilder.DropTable(
                name: "SysUserRole");
        }
    }
}
